Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it buildable on Windows with VS, and add windows Github Actions CI with vcpkg #75

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

adriweb
Copy link
Contributor

@adriweb adriweb commented Jan 19, 2023

This branch is already rebased on top of the other one with macOS/Linux CI, btw.

@adriweb
Copy link
Contributor Author

adriweb commented Jan 19, 2023

I'm not sure why not everything gets cached as I would have expected it for the vcpkg stuff, but anyway that can be solved later.

@adriweb adriweb force-pushed the feature/ci-windows branch 10 times, most recently from 402a304 to b88b521 Compare January 20, 2023 16:19
@adriweb
Copy link
Contributor Author

adriweb commented Jan 20, 2023

The install folder is now uploaded as artifacts (for each build) :)

@adriweb adriweb force-pushed the feature/ci-windows branch from b88b521 to 6da204d Compare January 23, 2023 09:14
@adriweb
Copy link
Contributor Author

adriweb commented Jan 23, 2023

Compatibility with the MinGW cross-build should be OK now.

@adriweb adriweb force-pushed the feature/ci-windows branch 4 times, most recently from 5aa6381 to 42525b0 Compare January 24, 2023 00:45
@adriweb adriweb changed the title Add windows github actions CI Make it buildable on Windows with VS, and add windows Github Actions CI with vcpkg Jan 24, 2023
@adriweb adriweb force-pushed the feature/ci-windows branch 6 times, most recently from 65dc215 to 04caffe Compare February 2, 2023 15:44
@adriweb adriweb force-pushed the feature/ci-windows branch from 04caffe to 472e62c Compare August 7, 2023 08:25
@adriweb adriweb force-pushed the feature/ci-windows branch 3 times, most recently from 1e42187 to 72c3bae Compare November 12, 2023 10:19
@@ -61,10 +61,10 @@ TIEXPORT4 ticonv_iconv_t TICALL ticonv_iconv_open (const char *tocode, const cha
/* Convert at most *INBYTESLEFT bytes from *INBUF according to the
code conversion algorithm specified by CD and place up to
*OUTBYTESLEFT bytes in buffer at *OUTBUF. */
TIEXPORT4 size_t TICALL ticonv_iconv (ticonv_iconv_t cd, char ** restrict inbuf,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh. This unconditionally reintroduces a previously long-standing known portability issue I fixed nearly 7 years ago in 933b4c6 .
Whatever the autotools build system does when configure.ac contains AC_C_RESTRICT - IIRC, something along the lines of replacing restrict by __restrict on a number of platforms - made libticonv cross-buildable for Win32 using the MinGW toolchain. I guess that the headers used by the MinGW toolchain - which must be drawing partially from MS headers - do not have the internal conflict with the Windows SDK you mention in the commit message ?
At least, this should be conditional on e.g. MSC_VER or the availability of the offending Windows SDK, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the following CMake test allows to conditionalize it:

if(NOT c_restrict IN_LIST CMAKE_C_COMPILE_FEATURES)
    add_compile_definitions(restrict=__restrict)
endif()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually nevermind, it's a bit more involved, but it should be doable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I see no way of making it work. __restrict seems to be the way to use on clang, gcc, and MSVC.
I suggest that if anything else is required somewhere, a #define be made.

@adriweb adriweb force-pushed the feature/ci-windows branch 4 times, most recently from b93a3a9 to 9322ef5 Compare November 21, 2023 20:51
@debrouxl
Copy link
Owner

I have integrated patches 1-3 and 5, and rebased experimental2 on top of those. It creates both conflicts for this PR and build failures on experimental2...

@adriweb
Copy link
Contributor Author

adriweb commented Nov 22, 2023

Okay, I'll rebase and push again

@adriweb
Copy link
Contributor Author

adriweb commented Nov 22, 2023

I'm not surprised about the static build failures on the other branches, and the fact that they are fixed here. I did indeed fix quite a few CMake things recently on this branch.

@debrouxl
Copy link
Owner

I've integrated 3 of the 5 patches at the front of the experimental2 branch (for now), in order to resolve the modify / delete conflicts caused by the torture_ticalcs.c -> torture_ticalcs.cc rename. I should dust off my cross-MinGW build procedure to test the result before forwarding the master branch.

@adriweb
Copy link
Contributor Author

adriweb commented Nov 25, 2023 via email

@adriweb adriweb force-pushed the feature/ci-windows branch 2 times, most recently from 449904b to 33cbaec Compare November 25, 2023 21:41
Note: we cannot simply do a -Drestrict=__restrict
because of an internal conflict with the windows SDK
@debrouxl
Copy link
Owner

I'll merge the remainder and perform some post-merge fixes.
Thanks for your work :)

@debrouxl debrouxl merged commit 33e1d37 into debrouxl:master Nov 26, 2023
10 checks passed
@adriweb adriweb deleted the feature/ci-windows branch November 26, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants